package com.example.huanhang.changzhouapp;

import android.app.Application;
import android.content.SharedPreferences;
import android.util.Log;

import com.taobao.sophix.SophixManager;
import com.tencent.bugly.Bugly;
import com.tencent.bugly.beta.Beta;

/**
 * @author : lei
 * @desc :
 * @date : 2018/9/6 0006  上午 9:36.
 * 个人博客站: http://www.bestlei.top
 */

public class MyApplication extends Application {
private SharedPreferences sp;
    @Override
    public void onCreate() {
        super.onCreate();
        sp = getSharedPreferences("isCheck", MODE_PRIVATE);
        Beta.initDelay = 1 * 1000;
        boolean check = sp.getBoolean("check", false);
        Log.e("asd", "onCreate: "+check);
        if (check == true) {
            Beta.autoDownloadOnWifi = true;
        } else {
            Beta.autoDownloadOnWifi = false;
        }
        // // TODO: 2018/9/6 0006  发布包时将ture改成false
        //是否开启debug模式，true表示打开debug模式，false表示关闭调试模式
        Bugly.init(getApplicationContext(), "7521d0b528", false);
        SophixManager.getInstance().queryAndLoadNewPatch();//查询是否有新的补丁
    }
}
